<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="../../static/mobile/default/css/layout.css?v=2" />
    <link rel="icon" type="image/png" href="../../static/favicon.ico" />
    <script src="../../static/js/jquery/jquery/2.1.4/jquery.min.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <script src="../../static/mobile/default/js/page.js?v=1"></script>
    <title>添加银行卡 - 达漂亮</title>

    <link rel="stylesheet" href="../../static/mobile/default/css/userData.css" />

</head>

<body>
    <div class="page takeOut">
        <div class="page-hd">
            <div class="header base-header bor-1px-b">
                <div class="header-left">
                    <a href="javascript:history.go(-1)" class="left-arrow"></a>
                </div>
                <div class="header-title">添加银行卡</div>
                <div class="header-right">
                    <!-- <a href=""></a> -->
                </div>
            </div>
        </div>

        <form id="bakn_from">
            <div class="page-bd userData">
                <!-- 页面内容-->
                <div class="cells">
                    <div class="cell bankType">
                        <div class="cell_hd"><span class="fs28 color_3 fw_b">开卡银行</span></div>
                        <div class="cell_bd">
                            <input type="text" class="fs28  color_3 bankBox" name="bank_name" placeholder="请输入开卡银行" value="">
                        </div>
                        <div class="cell_ft">
                        </div>
                    </div>
                    <div class="cell">
                        <div class="cell_hd"><span class="fs28 color_3 fw_b">持卡人</span></div>
                        <div class="cell_bd">
                            <input type="text" class="fs28  color_3" name="bank_cardholder" placeholder="请输入持卡人姓名">
                        </div>

                    </div>
                    <div class="cell">
                        <div class="cell_hd"><span class="fs28 color_3 fw_b">卡号</span></div>
                        <div class="cell_bd">
                            <input type="text" class="fs28  color_3" name="bank_card_number" placeholder="请输入卡号">
                        </div>
                    </div>
                    <div class="cell">
                        <div class="cell_hd"><span class="fs28 color_3 fw_b">持卡人电话</span></div>
                        <div class="cell_bd">
                            <input type="text" class="fs28  color_3" name="bank_cardholder_phone" placeholder="请输入持卡人电话">
                        </div>
                    </div>
                    <div class="cell">
                        <div class="cell_hd"><span class="fs28 color_3 fw_b">网点所在地</span></div>
                        <div class="cell_bd">
                            <input type="text" class="fs28  color_3" name="bank_location_outlet" placeholder="请输入网点所在地">
                        </div>
                    </div>
                    <div class="cell">
                        <div class="cell_hd"><span class="fs28 color_3 fw_b">支行名称</span></div>
                        <div class="cell_bd">
                            <input type="text" class="fs28 color_3" name="bank_branch_name" placeholder="请输入支行名称">
                        </div>
                    </div>
                </div>
                <div class="page-ft">
                    <span class="fs32 color_w fw_b BGcolor_r postBtn">确认添加</span>
                </div>
            </div>

        </form>

    </div>

    <script src="../../static/js/art-template.js"></script>
    <script src="../../static/mobile/default/js/lib/fastclick.js"></script>
    <script src="../../static/js/jquery/lazyload/jquery.lazyload.js"></script>
    <script>
        $(function() {
            FastClick.attach(document.body);
            $("img.lazy").lazyload({
                effect: "fadeIn",
                event: "scroll",
                container: $(".page-bd")
            });
            share()

            function share() {
                /***用户点击分享到微信圈后加载接口接口*******/
                var url = window.location.href;
                console.log("url:" + url);
                $.ajax({
                    url: "/api/mp/wxconfig",
                    type: "get",
                    data: {
                        shareUrl: url
                    },
                    headers: {
                        token: $.cookie('code')
                    },
                    dataType: "json",
                    success: function(data) {
                        wx.config({
                            debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参
                            //数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                            appId: data.data.appId, // 必填，公众号的唯一标识
                            timetamp: data.data.timetamp, // 必填，生成签名的时间戳
                            nonceStr: data.data.nonceStr, // 必填，生成签名的随机串
                            signature: data.data.signature, // 必填，签名，生成规则见微信公众号开发文档附录1
                            jsApiList: ['hideOptionMenu']
                        });
                        wx.ready(function() {
                            //ready会在config信息验证后执行，所有接口调用都必须在config接口获得结果后。
                            wx.hideOptionMenu({
                                success: function(res) {


                                },
                                fail: function(res) {

                                },
                            });
                        });
                    },
                    error: function() {
                        // 			_alert('ajax request failed!!!!');
                        return;
                    }
                })

            }
        });
    </script>

    <script>
        var account_id = "45";
        var number = "";
        $(function() {


            $('.postBtn').click(function() {
                var arr = $('#bakn_from').toJson();
                if (arr.bank_name == '') {
                    _alert('请输入银行名称.');
                    return false;
                }
                if (arr.bank_cardholder == '') {
                    _alert('请输入持卡人姓名.');
                    return false;
                }
                if (arr.bank_card_number == '') {
                    _alert('请输入卡号.');
                    return false;
                }
                if (arr.bank_cardholder_phone == '') {
                    _alert('请输入持卡人电话.');
                    return false;
                }
                if (arr.bank_location_outlet == '') {
                    _alert('请输入网点所在地.');
                    return false;
                }
                if (arr.bank_branch_name == '') {
                    _alert('请输入支行名称.');
                    return false;
                }
                jq_ajax('/member/api.withdraw/addbank.html', arr, function(res) {
                    if (res.code == 0) {
                        _alert(res.errmsg);
                        return false;
                    }
                    window.location.href = '/member/withdraw/banklist.html?account_id=' + account_id + '&number=' + number;
                });

            })
        })
    </script>

    <div class="alertBox">
        <div class="alertBG"></div>
        <div class="alert">
            <div class="text fs30 color_3 bor_b">

            </div>
            <!-- 单按钮 -->
            <div class="button fs32 fw_b color_r">
                知道了
            </div>
            <!-- 双按钮 -->
            <div class="buttonBox fs32 fw_b">
                <span class="color_9 bor_r cancel">取消</span>
                <span class="color_r confirm">确定</span>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var is_xcx = 0;
        $(document).on('click', 'a', function() {
            var href = $(this).attr('href');
            if (href.indexOf('/pages') != -1) {
                if (is_xcx == 1) {
                    wx.miniProgram.navigateTo({
                        url: href
                    })
                    return false;
                } else {
                    return false;
                }
            }
        })
    </script>
</body>

</html>